package com.aiit.datamanager.dao;


import com.aiit.datamanager.entity.DbInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DbInfoMapper {

    //查询DbInfo所有信息

    @Select({"select * from db_info"})
    List<DbInfo> selectAllDbInfo();

    @Select({"select * from db_info where db_id = #{DbId}"})
    DbInfo selectDbInfoByDbId(int DbId);


    @Select({"select * from db_info where db_name = #{DbName}"})
    List<DbInfo> selectDbInfoByDbName(String DbName);



    //新增一个DbInfo
    int insertDbInfo(DbInfo dbInfo);

    //删除DbInfo信息
    @Delete({"delete from db_info where db_id = #{dbId}"})
    int deleteByDbId(int dbId);
}
